package topday1_9.mxdx9;

/**
 * @Auther:小陈的Java
 * 定义抽象类Person和子类Officer(官员)以及 Peasantry（农名）
 */

public abstract class Person {
    public abstract void speck();

    public static void main(String[] args) {
        Person person = new Officer();
        person.speck();
        Person person1 = new Peasantry();
        person1.speck();
    }
}

class Officer extends Person{

    @Override
    public void speck() {
        System.out.println("官员说话：字正腔圆，严谨无误");
    }
}

class Peasantry extends Person{

    @Override
    public void speck() {
        System.out.println("农名说话：自由发言，无所顾虑");
    }
}
